package com.testing.vip14login.mapper;

import com.testing.vip14login.model.Person;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Classname PersonMapper
 * @Description 类型说明
 * @Date 2023/9/28 21:05
 * @Created by 特斯汀Roy
 */
@Mapper
public interface PersonMapper {

    //完成数据库查询操作
    @Select("select * from person")
    List<Person> listPersons();

    //返回影响的行数
    @Insert("insert into person values(#{name},#{age},#{salary})")
    int addPerson(String name,Integer age,Integer salary);

    @Update("update person set salary=#{salary} where username=#{username}")
    int updatePerson(Person roy);

    @Delete("delete from person where username=#{username}")
    int deleteByUserName(String username);


}
